package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 调用上传服务
 */
@FeignClient("upload-service")

public interface UploadService {

    /**
     * 调用文件上传接口
     * 1、@PostMapping 必须提供后属性 consumes, consumes 属性值是 multipart/form-data
     * 2、参数 MultipartFile 前增加注解 @RequestPart
     */

    @PostMapping(value="/upload/image",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     ResultVO<String> upload(@RequestPart MultipartFile pic) throws IOException;


}
